﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Lottery.Control;

namespace Lottery.MediaData.UI.Control {
    /// <summary>
    /// 和值 输入控件
    /// </summary>
    public partial class HZInput : UserControl {
        public HZInput() {
            InitializeComponent();

            m_controls.Add(hzControl1);
            m_controls.Add(hzControl2);
            m_controls.Add(hzControl3);
            m_controls.Add(hzControl4);
            m_controls.Add(hzControl5);
            m_controls.Add(hzControl6);
            m_controls.Add(hzControl7);
            m_controls.Add(hzControl8);
            m_controls.Add(hzControl9);
            m_controls.Add(hzControl10);
            m_controls.Add(hzControl11);
            m_controls.Add(hzControl12);
            m_controls.Add(hzControl13);
            m_controls.Add(hzControl14);
            for (int i = 0; i < m_controls.Count - 1; i++) {
                m_controls[i].JumpToNext = m_controls[i + 1];
            }

            for (int i = 0; i < m_controls.Count; i++) {
                m_controls[i].Index = i + 1;
            }
        }

        List<HZControl> m_controls = new List<HZControl>();

        public int Count { get { return m_controls.Count; } }

        public HZControl this[int index] { get { return m_controls[index]; } }

        public void SetAB(string a, string b) {
            editA.Text = a;
            editB.Text = b;
        }

        public void ClearData() {
            editA.Text = string.Empty;
            editB.Text = string.Empty;
            foreach (var item in m_controls) {
                item.ClearData();
            }
        }
    }
}
